import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:xvideos/hj_page/mine_business/ai/ai_mod_detail_page.dart';
import 'package:xvideos/hj_page/mine_business/ai/mode/AiModList.dart';
import 'package:xvideos/tools_base/widget/net_image_widget.dart';

class AIViodeoChangeFaceModView extends StatelessWidget {
  final TemplateModel modModel;
  const AIViodeoChangeFaceModView(this.modModel, {super.key});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        Get.to(AIModDetailPage(modModel));
      },
      child: Stack(
        fit: StackFit.expand,
        children: [
          NetworkImageLoader(
            imageUrl: modModel.cover ?? '',
            fit: BoxFit.cover,
            borderRadius: 0,
          ),
        ],
      ),
    );
  }
}

class AIImageChangeFaceModView extends StatelessWidget {
  final TemplateModel modModel;
  const AIImageChangeFaceModView(this.modModel, {super.key});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        Get.to(AIModDetailPage(modModel));
      },
      child: Column(
        children: [
          Expanded(
            child: Stack(
              fit: StackFit.expand,
              children: [
                NetworkImageLoader(
                  imageUrl: modModel.cover ?? '',
                  fit: BoxFit.cover,
                  borderRadius: 0,
                ),
              ],
            ),
          ),
          Container(
            width: double.infinity,
            color: Colors.white.withOpacity(.1),
            padding: EdgeInsets.symmetric(horizontal: 3, vertical: 6),
            child: Text(
              modModel.title ?? '',
              style: TextStyle(color: Colors.white, fontSize: 12),
              maxLines: 1,
            ),
          )
        ],
      ),
    );
  }
}
